package edu.neu.swc.commerce.dao;

import edu.neu.swc.commerce.entity.EcommerceOrder;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

public interface EcommerceOrderDao extends PagingAndSortingRepository<EcommerceOrder,Long> {

    /**
     * <h2>根据userId查询分页订单</h2>
     * select * from t_ecommerce_order where user_id = ? order by ... desc/asc limit x offset y
     */
    Page<EcommerceOrder> findAllByUserId(Long userId, Pageable pageable);
}
